<%-- 
    Document   : halamanKonfirmasi
    Created on : Nov 27, 2012, 5:20:55 PM
    Author     : User
--%>
<%bean.DataBaseConnection conn = new bean.DataBaseConnection();%>
<jsp:useBean id="input" scope="session" class="bean.Pemesan"/>
<jsp:useBean id="pemesan" scope="session" class="bean.Pemesan"/>
<%@ page import="java.sql.*" %>

<%@ page import="java.io.*"%>


<jsp:setProperty name="input" property="id" value="${param.idpesanan}"/>
<jsp:setProperty name="input" property="nama" value="${param.nama}"/>
<jsp:setProperty name="input" property="alamat" value="${param.alamat}"/>
<jsp:setProperty name="input" property="notlp" value="${param.notlp}"/>
<jsp:setProperty name="input" property="email" value="${param.email}"/>
<jsp:setProperty name="input" property="tanggal" value="${param.tanggal}"/>
<jsp:setProperty name="input" property="gender" value="${param.gender}"/>
<jsp:setProperty name="input" property="paket" value="${param.paket}"/>
<jsp:setProperty name="input" property="status" value="${param.status}"/>

<%
            try {

                String query = "insert into rplopesanan (idpesanan,nama, alamat, notlp ,email, tanggal, gender, paket, status)"
                        + " values ('" + input.getId() + "' , '" + input.getNama() + "' , '" + input.getAlamat()
                        + "' , '" + input.getNotlp() + "' , '" + input.getEmail() + "' , '" + input.getTanggal() + "' , '" + input.getGender() + "' , '" + input.getPaket()
                        + "' , 'Belum Dibayar' )";
                java.sql.Statement statement = conn.KoneksiDataBase().createStatement();
                int s = statement.executeUpdate(query);
                System.out.println("Data berhasil dimasukkan \n");



                statement.close();
            } catch (Exception ex) {
                out.println("message: " + ex.getMessage());
            }
%>


<%
            String id = request.getParameter("idpesanan");
            String nama = request.getParameter("nama");
            String alamat = request.getParameter("alamat");
            String email = request.getParameter("email");
            String nohp = request.getParameter("notlp");
            String d = request.getParameter("tanggal");
            String paket = request.getParameter("paket");
            String g = request.getParameter("gender");
            String tanggal = request.getParameter("tanggal");


%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Form Order</title>
    </head>
</head>
<body>
<style type="text/css">
            #main{
                border: solid;
                color: blue;
                background:white;
                font-weight: bold;
                margin-top: 100px;
                margin-left:120px;
                margin-right:127px;
                margin-bottom:135px;
                padding-right:60px; }

            #menuhor {
                list-style-type: none;
                margin: 0;
                padding: 0;
                float: center;
            }

            #menuhor li {
                margin: 0;
                padding: 0;
                float:left;
                text-align : center;
            }

            #menuhor a {
                display: block;
                width : 247px;
                color: #FFF;
                float : center;
                text-decoration: none;
                line-height:2.5;
                border-right: 3px solid white;
            }

            #menuhor a:hover {
                background: cyan;
            }
            #konten_utama{
                background-color:white;}

            #menuver{
                list-style-type: none;
                margin-left:-40px;
                margin-right:30px;
                padding:0;
                width : 170px;
                background-color:white;
                float:left;
            }
            #menuver li {
                margin:0;
                padding:0;
                float:center;
                text-align : center;
            }
            #menuver a {
                display:block;
                color:#FFF;
                text-decoration:none;
                padding:0.15px;
                line-height: 2.5;
                border-bottom: 3px solid white;
            }
            #menuver a:hover {
                background: cyan;
            }
            #footer{
                font-size: 14px;
                border: solid;
                color: blue;
                clear:both;
                text-align: center;
                background: white;
                margin-top: 350px;
                margin-bottom: 50px;
                height:70px;
                width :950px;
                float:center;

            }
            #konten{
                float:left;

                color: black;
                background: white;
                height:400px;
                width :730px
            }



        </style>
<body background ="background1.jpg">
    <ul id="main">
        <center><img src="banner.jpg"width="1000" height="300">

                <br>
                <ul id="menuhor" style="position:absolute;right:7px;left:173px;top:345px">
                    <font face="Comic sans MS">
                    <li><a href="HalamanUtama.jsp"><font color="Blue">Home</a> </li>
                    <li><a href="HalamanProfile.jsp"><font color="Blue">Profile</a></li>
                    <li><a href="HalamanWisata.jsp"><font color="Blue">Wisata</blink></a></li>
                    <li><a href="FormOrder.jsp"><font color="Blue">Order</a></li>
                </ul><br><br><hr>

                <ul id="konten_utama">

                    <ul id="menuver">
                        <center> Klik the link below to view packet travel</center>
                        <br>
                            <li><a href="HalamanWisata.jsp"><Marquee><font color="Blue">view packet travel </Marquee></a> </li>
                            <br>
                            </ul>
                    <ul id="konten">
                        <h2>YOUR ORDER ! THANK YOU </h2>
                        <table>
                            <tr>
                                <td>ID Pesanan</td> 
                                <td> <%=id%> </td>
                            </tr>
                            <tr>
                                <td>Nama</td>
                                <td> <%=nama%> </td>
                            </tr>
                            <tr>
                                <td> Alamat</td>              
                                <td> <%=alamat%> </td>
                            </tr>
                            <tr>
                                <td> noHp</td>              
                                <td> <%=nohp%></td> <br>
                            </tr>
                            <tr>
                                <td> Email</td>              
                                <td> <%=email%></td> <br>
                            </tr>
                            <tr>
                                <td>gender</td>
                                <td><%if (g.matches("l")) {%>
                                    laki-laki 
                                    <% } else if (g.matches("p")) {%>
                                    perempuan <%}%> </td>
                            </tr>
                            <tr>
                                <td>paket</td>
                                <td><%=paket%></td>
                            </tr>
                            <tr>
                                <td> tanggal keberangkatan</td>
                                <td> <%=tanggal%></td> <br>

                            <%
                                        System.out.println(request.getParameter("paket"));

                                        String query = "select r.jamberangkat, r.namatourguide, r.harga from rploinformasi r , rplopesanan p where idpesanan = '" + id + "' and r.namapaket  = '" + request.getParameter("paket") + "'";
                                        System.out.println(query);
                                        java.sql.Statement statement = conn.KoneksiDataBase().createStatement();
                                        java.sql.ResultSet result = statement.executeQuery(query);

                                        while (result.next()) {

                            %>

                            <tr>

                                <td>jam berangkat </td>
                                <td> <%=result.getString(1)%></td>
                            </tr>
                            <tr>
                                <td>nama tour guide</td>
                                <td><%=result.getString(2)%></td>
                            </tr>
                            <tr>
                                <td>harga</td>
                                <td><%=result.getString(3)%></td>

                            </tr>
                            <%
                                        }
                                        result.close();
                            %>

                        </table>
                        <br>



                        <%
                                    Connection con = null;
                                    //String dbname = "jdbc:oracle:thin:@localhost:1521:XE";
                                    String dbname = "jdbc:oracle:thin:@172.23.9.185:1521:ORCL";
                                    String status = "";
                                    ResultSet rs = null;
                                    try {
                                        Class.forName("oracle.jdbc.driver.OracleDriver");
                                        //con = DriverManager.getConnection(dbname, "hr", "hr");
                                        con = DriverManager.getConnection(dbname, "MHS105314093", "MHS105314093 ");
                                        if (con == null) {
                                            status = "gagal";
                                        } else {
                                            status = "berhasil";
                                        }
                                    } catch (ClassNotFoundException ex) {
                                        status = "Driver Error";
                                    } catch (SQLException ex) {
                                        status = "gagal";
                                    }
                                    Statement st = con.createStatement();
                                    String kueri = "SELECT idpesanan, nama, paket,alamat, tanggal from rplopesanan where paket = '" + paket + "' and tanggal = '" + tanggal + "'";
                                    rs = st.executeQuery(kueri);

                        %><br>

                        Rombongan Anda
                        <table width="100%" border="1">
                            <tr bordercolor="#666666" bgcolor="#999999">
                                <td width="20%">ID Pesanan</td>
                                <td width="20%">Nama</td>
                                <td width="20%">Paket</td>
                                <td width="20%">Alamat</td>
                                <td width="20%">Tanggal</td>
                            </tr>
                            <%

                                        if (rs != null) {
                                            while (rs.next()) {
                                                String idpesanan2 = rs.getString(1);
                                                String nama2 = rs.getString(2);
                                                String paket2 = rs.getString(3);
                                                String alamat2 = rs.getString(4);
                                                String tanggal2 = rs.getString(5);



                            %>
                            <tr>
                                <td><%=idpesanan2%></td>
                                <td><%=nama2%></td>
                                <td><%=paket2%></td>
                                <td><%=alamat2%></td>
                                <td><%=tanggal2%></td>



                            </tr>
                            <% }
                                        }
                                        st.close();
                                        con.close();

                            %>
                        </table>














                        <br>

                        setelah mendaftar silahkan kirim biaya yang diperlukan dengan id pesanan sebelum hari keberangkatan pada : <br>
                        BRI : 1234151409881 a/n Cyber Travel <br>
                        BCA : 121298976566715 a/n Cyber Tour <br>
                        Setelah mengirim silahkan konfirmasi ke 085627000007 <br>
                        Setelah semuanya selesai silahkan datang dengan id pesanan dan ktp untuk mengambil kursi yang di pesan

                        <font color="red"><marquee><i> thank you for your order </i></marquee>
                        </font>
                        <center><FORM   action="HalamanUtama.jsp" method="post">
                            <INPUT TYPE="submit" VALUE="Kembali ke halaman utama">   </FORM></center>

                    </ul>



                </ul>
                <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
                <ul id="footer">

                    Queries Executed: 0 queries | Page Generation Time: 0.00265 seconds <br>
                    Travel Agent 2.0.4 Beta 10 (Revision 363). Coded by Ardy. Skin coded by Amel and designed by Fave, Hohok
                    All registered trademarks belong to their respective owners. Travel Agent Online and all related content are trademark of Gravity CO. Ltd.
                </ul></font>

                </body>
                </html>
